package com.manolovn.trianglify.renderer;

import com.manolovn.trianglify.domain.Point;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.Color;

import java.util.Vector;

/**
 * Point renderer
 */
public class PointRenderer {
    private int radius = 10;
    private Paint paint = new Paint();

    public PointRenderer() {
        paint.setStyle(Paint.Style.FILL_STYLE);
        paint.setAntiAlias(true);
        paint.setStrokeWidth(0);
        paint.setColor(new Color(Color.argb(125, 125, 125, 125)));
    }

    /**
     * this method is used to draw circles
     *
     * @param points number of points of cirlce need to be render
     * @param canvas it will paint all circles on screen
     */
    public void render(Vector<Point> points, Canvas canvas) {
        for (Point point : points) {
            canvas.drawCircle(point.x, point.y, radius, paint);
        }
    }
}

